package com.itwn.comic.mapper;

import com.itwn.comic.entity.Resource;
import com.itwn.comic.vo.ResourceVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface ResourceMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Resource record);

    Resource selectByPrimaryKey(Integer id);

    List<Resource> selectAll();

    int updateByPrimaryKey(Resource record);

    List<ResourceVo> selectRoleByName(@Param("name") String name);

    @Delete("delete from t_section where resource_id = #{value`}")
    void deleteByParentId(int id);

    int lockResources(@Param("id") Integer id,@Param("status") Integer status);
}